package com.terry.utils;

import java.io.InputStream;
import java.util.Properties;

public class PropertiesUitl {

	private final static String path = "/application.properties";
	private static Properties p = new Properties();
	
	static {
		try {
			System.out.println("****************");
			InputStream is = PropertiesUitl.class.getResourceAsStream(path);
			p.load(is);
		} catch (Exception e) {
			e.printStackTrace();
		} 
	}
	
	public static String getProperties(String key, String defaultValue) {
		return p.getProperty(key, defaultValue);
	}
	
	public static String getProperties(String key) {
		return p.getProperty(key, "");
	}
	
	public static void main(String[] args) {
		System.out.println(PropertiesUitl.getProperties("target_port"));
	}

}
